package zero.boot.freemarkerdemo.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import zero.project.advice.annotation.MethodInvokeAdvice;

import java.util.HashMap;
import java.util.Map;

@Controller
public class DemoController {

    @GetMapping("/index")
    public String index() {
        return "/index";
    }

    @GetMapping("/test")
    @ResponseBody
    @MethodInvokeAdvice
    public Map<String, Object> jsonTest() {
        String a = "123";
        Map<String, Object> map = new HashMap<>();
        map.put("key1", a);
        return map;
    }

}
